<template>
    <div>
        <div><h1>管理员首页</h1></div>
        <div>
            <div id="main" style="width: 600px; height: 400px;"></div>
        </div>
    </div>
</template>

<script setup lang="ts">
import * as echarts from "echarts";
import { onMounted, ref } from "vue";

var myChart = null;

onMounted(() => {
    // 基于准备好的dom，初始化echarts实例
    myChart = echarts.init(document.getElementById("main"));
    // 绘制图表
    myChart.setOption({
        title: {
            text: "酒店信息统计",
        },
        tooltip: {},
        xAxis: {
            data: ["万达酒店", "格林豪泰", "桔子酒店", "宜家酒店", "国贸酒店", "金顶酒店"],
        },
        yAxis: {},
        series: [
            {
                name: "房间数量",
                type: "bar",
                data: [5, 20, 36, 10, 10, 20],
            },
        ],
    });
});
</script>

<style scoped></style>
